package ua.org.enginer.tracking
{
	import flash.events.Event;
	
	import mx.containers.ViewStack;
	import mx.events.IndexChangedEvent;
	
	public class ViewStackTrackingImpl extends ContainerTrackingImpl
	{
		public function ViewStackTrackingImpl(target:ViewStack) {
			super(target)
			ViewStack(target).addEventListener(IndexChangedEvent.CHANGE, onSwitch)
		}
		
		protected function onSwitch(event:Event):void {
			tracker.trackPageview(ViewStack(target).selectedChild.label)
		}
	}
}